<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="header::header" />
<body>
	<div id="dgtoolbar" class="datagrid-toolbar">
		<a id="querybtn" href="#" class="easyui-linkbutton" iconCls="icon-search" plain="true">查询</a>
		<a id="newbtn" href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" title="新增">新增</a>
		<a id="deletebtn" href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" title="批量删除">删除</a>
		<a id="reloadbtn" href="#" class="easyui-linkbutton" iconCls="icon-reload" plain="true">刷新</a>
	</div>
	<!-- 表格 -->
	<table id="dg" class="easyui-datagrid" data-options="url:'pageQuery',idField:'iid',rownumbers:true,singleSelect:false,method:'post',toolbar:'#dgtoolbar',pagination:true,pageSize:20,pageList:[20,30,50],fit:true,onLoadSuccess:onDGLoadSuccess">
		<thead>
			<tr>
				<th data-options="field:'iid'" checkbox="true"></th>
				<th data-options="field:'cname'" width="150" align="center">收藏用户</th>
				<th data-options="field:'ctitle'" width="150" align="center">收藏文件</th>
				<th data-options="field:'itype'" formatter="formatteritype" width="150" align="center">文件分类</th>
				<th data-options="field:'dcreator'" width="150" align="center">添加时间</th>
				<th data-options="field:'opt1',formatter:onItemOptDelete" width="40" align="center">删除</th>
				<th data-options="field:'opt2',formatter:onItemOptShow" width="40" align="center">查看</th>
			</tr>
		</thead>
	</table>
	<!-- 弹出框新增 -->
	<div id="dlg" class="easyui-dialog" title="操作" style="padding:5px;width: 290px" data-options="buttons: '#dlg-buttons',closed:'true',modal:true">
		<form id="dataform" method="post" enctype="multipart/form-data">
			<table>
				<tr>
					<td>收藏用户:</td>
					<td><input name="iid" id="iid" type="hidden"></input> 
					<input name="iuserid" class="easyui-numberbox" style="width: 200px" data-options="required:true" ></input></td>
				</tr>
				<tr>
					<td>收藏文件:</td>
					<td><input name="ifileid" class="easyui-numberbox" style="width: 200px" data-options=""></input></td>
				</tr>
				<tr>
					<td>文件分类:</td>
					<td>
						<input id="itype" name="itype" class="easyui-combobox" style="width: 200px" data-options="panelHeight:'auto',required:true,url:'../dicdetails/findItems?ckey=itype',valueField:'cvalue',textField:'cname'"></input>
					</td>
				</tr>
			</table>
		</form>
	</div>
	<!-- 弹出框工具栏 -->
	<div id="dlg-buttons">
		<a id="dlg-savebtn" href="javascript:void(0)" style="width:50" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
		<a id="dlg-closebtn" href="javascript:void(0)" style="width: 50;" class="easyui-linkbutton" iconCls="icon-no">关闭</a>
	</div>
	<!-- 弹出框查询 -->
	<div id="dlg-query" class="easyui-dialog" title="查询" style="padding: 5px;width: 290px" data-options="buttons: '#dlg-query-buttons',closed:'true',modal:true">
		<form id="dataform-query" method="post">
			<table>
				<tr>
					<td>收藏用户:</td>
					<td><input name="cname" class="easyui-textbox" style="width: 200px" /></td>
				</tr>
				<tr>
					<td>收藏文件:</td>
					<td><input name="ctitle" class="easyui-textbox" style="width: 200px" /></td>
				</tr>
				<tr>
					<td>文件类型:</td>
					<td>
						<input id="itype" name="itype" class="easyui-combobox" style="width: 200px" data-options="panelHeight:'auto',required:true,url:'../dicdetails/findItems?ckey=itype',valueField:'cvalue',textField:'cname'"></input>
					</td>
				</tr>
			</table>
		</form>
	</div>
	<div id="dlg-query-buttons">
		<a id="dlg-query-savebtn" href="javascript:void(0)" style="width: 50" class="easyui-linkbutton" iconCls="icon-search">查询</a>
		<a id="dlg-query-closebtn" href="javascript:void(0)" style="width: 50" class="easyui-linkbutton" iconCls="icon-no">关闭</a>
	</div>
</body>
<script type="text/javascript" th:src="@{/common/GridView.js}"></script>
<script type="text/javascript">
    function formatteritype(value, row, index){
        if(row.itype==1){
            return "图文";
        }else if(row.itype==2){
            return "视频";
        }
    }
</script>
</html>